package com.wordpress.javagameengine.lazarek.dominik;

import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Double;
import java.awt.image.BufferedImage;

/**
 * This class represents a Sprite to youse in your game. It is derived from Rectangle2D.Double in order to provide
 * some basic collision- detection
 * @author dommme
 *
 */
public class Sprite extends Rectangle2D.Double
{
	private BufferedImage[] texture;
	private int animationIndex; //index for the animation- sequence- array
	private boolean hasAnimation; //determines whether the Sprite has an animation sequence or not
	
	/**
	 * the current position of the sprites in screen- coordinates
	 */
	public Vector2 position;
	
	/**
	 * This Constructor creates a simple Sprite without any animation
	 * @param _texture the Texture of the Sprite
	 */
	public Sprite(BufferedImage _texture)
	{
		this.texture = new BufferedImage[1];
		this.texture[0] = _texture;
		this.hasAnimation = false;
		this.animationIndex = 0;
	}
	
	/**
	 * This Constructor creates a Sprite with an animation Sequence.
	 * @param _animationSequence The different animation- pics which are played during animation
	 */
	public Sprite(BufferedImage[] _animationSequence)
	{
		this.texture = _animationSequence;
		this.hasAnimation = true;
		this.animationIndex = 0;
	}
	
	public void drawSprite(Graphics g)
	{
		//g.drawImage(this.texture[animationIndex], x, y, bgcolor, observer)
	}
	
	
}//end class
